export const range = function (start, end) {
  if (!end) {
    end = start
    start = 0
  }
  return [...Array(end - start).keys()].map(v => v + start)
}
export const getRndInteger = function (min, max) {
  return Math.floor(Math.random() * (max - min + 1)) + min
}

export const getCookie = (val) => { // 获取x-csrf-token字段
  var arr; var reg = new RegExp('(^| )' + val + '=([^;]*)(;|$)')
  // eslint-disable-next-line
  if (arr = document.cookie.match(reg)) { return unescape(arr[2]) } else { return null }
}
